//
//  WH_PastCell.m
//  App_6.23
//
//  Created by wanghao on 16/7/12.
//  Copyright © 2016年 wanghao. All rights reserved.
//

#import "WH_PastCell.h"
#import "WH_Home.h"

@interface WH_PastCell ()

@property (weak, nonatomic) IBOutlet UILabel *periodLabel;
@property (weak, nonatomic) IBOutlet UIImageView *avatrLabel;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *IPLabel;
@property (weak, nonatomic) IBOutlet UILabel *numbLabel;
@property (weak, nonatomic) IBOutlet UILabel *countLabel;

@property (weak, nonatomic) IBOutlet UILabel *IDLabel;

@end

@implementation WH_PastCell

-(void)setPastHome:(WH_Home *)pastHome{
    
    if (_pastHome != pastHome) {
        
        _pastHome = pastHome;
    }
    
    self.periodLabel.text = [NSString stringWithFormat:@"  期号: %@(揭晓时间: %@)",self.pastHome.product_period_no,self.pastHome.product_period_time];
    [self.avatrLabel sd_setImageWithURL:[NSURL URLWithString:self.pastHome.user_avatar] placeholderImage:nil];
    self.nameLabel.text = [NSString stringWithFormat:@"获得者: %@",self.pastHome.user_name];
    self.IPLabel.text = [NSString stringWithFormat:@"(IP: %@)",self.pastHome.user_ip];
    self.IDLabel.text = [NSString stringWithFormat:@"用户ID: %@(唯一不变标识)",self.pastHome.user_id];
    self.numbLabel.text = [NSString stringWithFormat:@"幸运号码: %@",self.pastHome.jiang_number];
    self.countLabel.text = [NSString stringWithFormat:@"本期参与: %@人次",self.pastHome.order_count];
    [WH_AppTools changeColor:self.countLabel.text color:[UIColor redColor] xx:self.pastHome.order_count nn:self.countLabel];
    [WH_AppTools changeColor:self.numbLabel.text color:[UIColor redColor] xx:self.pastHome.jiang_number nn:self.numbLabel];
    [WH_AppTools changeColor:self.nameLabel.text color:[UIColor blueColor] xx:self.pastHome.user_name nn:self.nameLabel];

}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
